#pragma once

#include "glad/glad.h"
#include "glm/glm.hpp"
#include <string>

class Shader
{
public:
    Shader(const std::string &vertexShaderPath, const std::string &fragmentShaderPath);
    virtual ~Shader();

    void use();

    void setBool(const std::string &name, bool value) const;
    void setInt(const std::string &name, int value) const;
    void setFloat(const std::string &name, float value) const;
    void setVec2(const std::string &name, glm::vec2 &value) const;
    void setVec2(const std::string &name, float x, float y) const;
    void setVec3(const std::string &name, glm::vec3 &value) const;
    void setVec3(const std::string &name, float x, float y, float z) const;
    void setVec4(const std::string &name, glm::vec4 &value) const;
    void setVec4(const std::string &name, float x, float y, float z, float w) const;
    void setMat2(const std::string &name, glm::mat2 &mat) const;
    void setMat3(const std::string &name, glm::mat3 &mat) const;
    void setMat4(const std::string &name, glm::mat4 &mat) const;

    GLuint getID() { return m_ID; }

private:
    void checkCompileErrors(GLuint shader, std::string type);

private:
    GLuint m_ID;
};